Skip to content

Conversation

@fatfingers23
Copy link

I've been working on a citro2d rust wrapper for citro2d. It's not finished, and it's still pretty early. But I have 2D Shapes rendering and figured this would be a good place to make a draft or share my work. My goal for it is to be able to make simple 2d games easily for the 3ds with rust and allow others to be able to do the same.

I plan to finish it out, but I'm sure we all know how that can go. So, I am making this draft PR so it is easy to find in relation to this project and get some feedback before continuing.

Concerns

  • In side of the citro2d crate I had to import citro3d-sys. Since citro2d is built on top of citro3d there was a lot of calls to the library I needed to make. Some of this may be better handled inside of citro3d-rs
  • A lot of other code inside of citro2d-rs looks like it can be shared with citro3d, such as Target. It returns a 3D target from the c library, but it's a 2D method to create it. And a few other places, I decided to go with its own implementations in a lot of places for speed and ease to get a proof of concept working.
  • Not sure if the API style for shapes and inside the render and lib is best, but I took inspiration from citro3d. Another reason to make this PR was to get feedback on this before building out the other features

TODO

  • Be able to build and import citro2d as well as ability to make calls to the library with success
  • 2D shapes
  • Text/Fonts. Not in this pr but I have done a bit on this and a start in the repo this pr is coming from
  • Spritesheets
  • Scaling, flipping, and rotation of graphics

The 2d_Shapes example minus the text on the bottom screen
image

A link to a video showing the breakout example

@sheepy0125
Copy link

woah, I totally missed this, but I was working on a similar thing. My implementation is very hacked together and not at all usable in a library form -- I'm just using it for a few side projects of my own. I'd love to be involved in this as a contributor if you're interested.

https://git.sr.ht/~sheepy/citro2d-rs

@heydocode
Copy link

Awesome work! I may contribute too.

I have a low-priority task on my game roadmap: adding 3DS support to Bevy (my game is built on Bevy). This is doable because Bevy is extremely modular. All the modules my game needs—except the renderer, which uses std but will be replaced with a custom 3DS renderer—are already no_std.

3DS support in Bevy will grow progressively, and not all features may be implemented, as some don't make sense for the 3DS (e.g., heavy rendering techniques, advanced rendering pipelines, shader compilation from WGSL to 3DS-compliant shader language). Some fallback mechanisms may be added, allowing developers to provide a second, simpler shader that can be used when building for 3DS.

What do you think about and do you have any considerations to share?

@heydocode
Copy link

Just imagine doing 3DS games with high level elements, without even seeing any of rendering and complicated stuff, hidden behind its ECS. Also, if you want for whatever reason compile your game to Web, Android, iOS, Linux, ..., you don't have to worry that much 😇

@sheepy0125
Copy link

sheepy0125 commented Apr 26, 2025 via email

@fatfingers23
Copy link
Author

Hey, sorry. I've been away from my computer for the weekend. I was happy to see some discussions here!

@heydocode bushrat may be who you'd like to talk to about 3DS and bevy. They led and did most of the no_std work that was merged into Bevy recently. I had tried getting the beta of it working but ran into a couple of errors getting it to compile. But I do know he has an interest in getting it to run, no idea on anything for sure or current on that.
https://bsky.app/profile/bushr.at/post/3ljvsydxtv22s

@sheepy0125
Always welcome contributions! I have not had the time lately to work on this. Can feel free to make contributions to my repo and this branch if you want to add to it! I hate to splinter any 3DS rust projects off from the main organization since this is where most would come and it is built off of their work.

But I am open to any suggestions from the rust3ds team! If we should clean this up and get it to work better with the current work on citro3d, or if they may be willing to create a citro2d repo, since it looks like the two will be somewhat similar, but different enough, a separate repo may be fine.

@sheepy0125
Copy link

sheepy0125 commented Apr 28, 2025 via email

@ian-h-chamberlain
Copy link
Member

ian-h-chamberlain commented Apr 29, 2025

Hey all, I guess I'm kinda the primary maintainer for citro3d-rs now, although I have been kinda inactive (especially lately as I'm in the midst of planning a big move right now). Once I'm settled after my move I hope to have some more time to get back to Rust3DS stuff!

I think we could definitely take on a new repo for this kind of work, although I'd want to make sure someone was willing to maintain it, as we already have kind of limited resources for that. This repo started its life in my github and was moved here eventually, so I could se a similar path would probably make sense. From a technical standpoint it's also possible it would make more sense to just keep them in the same repo (like this PR), so maybe that's worth looking at more closely before making any real decision. I'd encourage folks to continue working on this in @fatfingers23 's fork for now if you plan to work on this.

Regarding Bevy integration: I had started working on it at one point (and did actually get something basic working) but more recently another team built (to my understanding) a whole game using https://github.com/Team-Yarg/bevy_3ds . I believe it depends on some changes still in review for this repo, which I have been slow to review 😞

If y'all want to continue this conversation it might be helpful to create a discussion post for threading purposes but since this is a draft PR I guess it's fine here too.

It's awesome to see people still interested in further development of 3ds homebrew stuff, I hope to have more time to contribute and really get this repo into a more functional / maintained state soon!

@fatfingers23
Copy link
Author

That sounds great to me. Thank you for taking the time to give us some insight, @ian-h-chamberlain!

I agree and welcome any PRs for work done on citro2d to my fork. I have set the branch feature/Citro2DStart as the default one, and it is the one linked to this PR. Once we get all the items done in the top list and in the functional state, I will flip this PR from a draft to published, and we can see about getting it merged. If any conversation grows from this and some want to make a serious effort at contributing, then I will open up a discussion thread in rust3ds's org for us to talk about it and to answer any questions.

Thank you everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants